package com.kgc.provider;

import com.alibaba.dubbo.config.annotation.Service;
import com.kgc.api.goods.OrderApi;
import com.kgc.bean.OrderInfo;
import com.kgc.bean.OrderItem;
import com.kgc.mapper.OrderMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;

import java.util.List;

@Slf4j
@Service
public class OrderProvider implements OrderApi {
    @Autowired
    private OrderMapper orderMapper;
    @Override
    public OrderInfo queryOrderInfoByOrderId(String orderId) {

        return orderMapper.queryOrderInfoByOrderId(orderId);
    }

    @Override
    public List<OrderInfo> queryAllOrdersByOrderState(Integer userId, Integer orderStateCode) {
        return orderMapper.queryAllOrdersByOrderState(userId,orderStateCode);
    }

    @Override
    public List<OrderInfo> queryAllOrders(Integer userId) {
        return orderMapper.queryAllOrders(userId);
    }

    @Override
    public Boolean saveOrderItem(OrderItem orderItem) {
        return orderMapper.saveOrderItem(orderItem);
    }

    @Override
    public Boolean saveOrderInfo(OrderInfo orderInfo) {
        return orderMapper.saveOrderInfo(orderInfo);
    }


}
